package com.tjl.warehouse.controller;

import cn.hutool.core.date.DateUtil;
import com.tjl.warehouse.annotation.AuthToken;
import com.tjl.warehouse.common.R;
import com.tjl.warehouse.common.ResultUtils;
import com.tjl.warehouse.model.Store;
import com.tjl.warehouse.model.UserInfo;
import com.tjl.warehouse.service.StoreService;
import com.tjl.warehouse.service.UserInfoService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Tang
 * @Date 2024/5/10
 */
@RequestMapping("/test")
@RestController
public class TestController {

    @Resource
    UserInfoService userInfoService;
    @Resource
    StoreService storeService;

    @GetMapping()
    @AuthToken
    public R<List<UserInfo>> test() {
        return ResultUtils.success(userInfoService.list());
    }

    @GetMapping("/store")
    public R<List<Store>> test2() {
        return ResultUtils.success(storeService.list());
    }

}
